import axios from "axios";

const httpInstance = axios.create({
    baseURL: 'https://pcapi-xiaotuxian-front-devtest.itheima.net', // 1. 接口基地址
    timeout: 50000, // 2. 超时时间
})

// 请求拦截器
httpInstance.interceptors.request.use(config => {
    return config
}, e => Promise.reject(e))

// 响应拦截器
httpInstance.interceptors.response.use(res => {
    return res.data
}, e => {
    return Promise.reject(e)
})
export default httpInstance